Skip to content

ProjectionView: pass the renderer status and painting to the embedder - #146

Merged
agorischek merged 1 commit into
mainfrom
view-status-events
Nov 21, 2026
Merged

agorischek merged 1 commit into
mainfrom
view-status-events

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

#122 added onRendererStatusChange and onPainted to useProjection's options, but ProjectionView didn't take them as props. So a host using the prebuilt view still had to watch its data-renderer-status attribute to learn when the renderer drew or failed. A hosted carousel does exactly that with a MutationObserver, and will move to these props.

  • packages/host/core/src/ui/view/props.ts: ProjectionViewProps gains onRendererStatusChange and onPainted.
  • packages/host/core/src/ui/view/options.ts: viewOptions forwards both to useProjection.
  • docs/guides/host-ui.md lists them with the view's other integration props.

Test: paint.test.mjs checks that viewOptions passes both callbacks through. tools check --fast passes.

useProjection's onRendererStatusChange and onPainted (#122) weren't
ProjectionView props, so a host using the prebuilt view still had to
observe its data-renderer-status attribute. The view now takes both and
forwards them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change exposing renderer-status and paint callbacks through ProjectionView.

No open issues 🎉

What changed in this PR

Exposes the status and paint callbacks added to useProjection in #122 through ProjectionView, allowing embedders to receive these events without observing DOM attributes.

Changes:

  • Adds typed onRendererStatusChange and onPainted props and forwards them to useProjection.
  • Adds a regression test confirming both callbacks pass through unchanged.
  • Documents the callbacks alongside the view’s other integration props.
File Description
packages/​host/​core/​test/​paint.test.mjs Tests callback forwarding through viewOptions.
packages/​host/​core/​src/​ui/​view/​props.ts Declares and documents both callback props.
packages/​host/​core/​src/​ui/​view/​options.ts Forwards both callbacks to the controller options.
docs/​guides/​host-ui.md Documents event-based integration for embedders.

Review effort: Balanced

@agorischek
agorischek merged commit 9d078cd into main Nov 21, 2026
83 of 85 checks passed
@agorischek
agorischek deleted the view-status-events branch November 21, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants